function Table = getBitValLoc_8PSK(M)
%*------------------------------ getBitValLoc_8PSK ----------------------------------%
%
% getBitValLoc_8PSK
%
% This function calculate outs 3 dimension table where each layer refer
% to bit where the first row for symbols where this bit is zero value and the
% next row for symbols where this bit is one and so one for each layer and
% refer for certain bit of 8psk 3bits
%
%
%
%*-------------------------------------------------------------------------
global  LUT_PSK_Q_8

b0zeros = [1 2 5 6]+1 ;
b0ones  = [0 3 4 7]+1 ;
 
b1zeros = [0 1 6 7]+1 ; 
b1ones =  [2 3 4 5]+1 ;

b2zeros = [0 1 2 3]+1 ; 
b2ones =  [4 5 6 7]+1 ;

% load LUT_PSK_Q_8
const=LUT_PSK_Q_8;

%===  Table(:,:,1) is MSB
%===  Table(:,:,M) is LSB
for n = 1:3
    Table(:,:,n) = eval(['[const(b',num2str(3-n),'zeros); const(b',num2str(3-n),'ones)];']);
end
